<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>预编译</title>
</head>

<body>
    <script>
        //GO
        console.log(a);
        a = 100;
        function a() { };
        console.log(a);
        var a;
    </script>
    <script>
        //AO
        function fn(a) {
            console.log(a);
            var a = 123;
            console.log(a);
            function a() { }
            console.log(a);
            var b = function () { }
            console.log(b);
            function d() { }
            console.log(d)
        }

        fn(1)
    </script>
    <script>
        //GO+AO
        console.log(test);
        // console.log(a)
        a = 100;
        function test(a) {
            console.log(a);
            function a() { }
            console.log(a);
            var a = 300;
        }
        test(a);
    </script>
</body>

</html>